<?php	
	//connects to a db and run given queery, return the results.

	
	function executeQuerry($querry)
	{	
		//
		// Make sure we can connect to the mysql server
		//
		$link = mysql_connect("dunk.it.jcu.edu.au", "cp3003_09_g05", "722cf33b8d");
		if(!$link) 
		{
			die('Unable to connect: ' . mysql_error());
		}
		
		//
		// Make sure we can connect to the right database
		//
		$db_selected = mysql_select_db("cp3003_09_g05");
		if(!$db_selected)
		{
			die('Access permission denied: ' . mysql_error());
		}	
				
		$results = mysql_query($querry);
					
		// Closing connection
		mysql_close($link);

		return $results;
	}	
?>
